<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	template="/layout/template.xhtml">

	<ui:define name="body">

		<h:form id="formofthekings">

			<rich:panel>
				<f:facet name="header">#{messages.viewUser}</f:facet>

				<h:panelGrid columns="2">

					<h:graphicImage value="/img/generic_user_image.jpg"
						rendered="#{userHome.instance.picture==null}" />
					<s:graphicImage rendered="#{userHome.instance.picture!=null}"
						value="#{userHome.instance.picture}" />

					<s:div>

						<s:decorate id="nameField" template="/layout/display.xhtml">
							<ui:define name="label">#{messages.userName}</ui:define>
							<h:outputText value="#{userHome.instance.username}" />
						</s:decorate>

						<s:decorate id="email" template="/layout/display.xhtml">
							<ui:define name="label">#{messages.email}</ui:define>
							<h:outputText value="#{userHome.instance.email}" />
						</s:decorate>

						<s:decorate id="name" template="/layout/display.xhtml">
							<ui:define name="label">#{messages.name}</ui:define>
							<h:outputText value="#{userHome.instance.name}" />
						</s:decorate>
						<s:decorate id="surname" template="/layout/display.xhtml">
							<ui:define name="label">#{messages.surname}</ui:define>
							<h:outputText id="name" value="#{userHome.instance.surname}" />
						</s:decorate>
						<s:decorate id="duedate" template="/layout/display.xhtml">
							<ui:define name="label">#{messages.dueDate}</ui:define>
							<h:outputText value="#{userHome.instance.dueDate}">
								<s:convertDateTime type="date" dateStyle="short"
									pattern="dd/MM/yyyy" />
							</h:outputText>
						</s:decorate>

						<s:decorate id="type" template="/layout/display.xhtml">
							<ui:define name="label">#{messages.type}</ui:define>
							<h:outputText value="#{userHome.instance.userRolesString()}" />
						</s:decorate>
					</s:div>
				</h:panelGrid>

			</rich:panel>



			<s:button id="edit" value="#{messages['btn.edit']}"
				view="/Settings/User/editUser.xhtml" />
			<s:button propagation="end" id="cancel"
				value="Cancel" view="#{userHome.path}" />
		</h:form>

	</ui:define>

</ui:composition>
